package cn.liubanglong.i18n.controller;

import cn.liubanglong.i18n.common.ApiResult;
import cn.liubanglong.i18n.orm.entity.TestEntity;
import cn.liubanglong.i18n.service.TestService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 测试接口
 *
 * @author liubanglong
 * @since 2025-01-09
 */
@RestController
@RequestMapping("/test")
@RequiredArgsConstructor
public class TestController {
    private final TestService testService;

    @GetMapping("/add")
    public ApiResult<Void> add() {
        testService.add();
        return ApiResult.ok();
    }

    @GetMapping("/list")
    public ApiResult<List<TestEntity>> list() {
        return ApiResult.ok(testService.list());
    }
}
